import request from '@/utils/request'

export function memberList(query) {
  return request({
    url: '/admin/list',
    method: 'get',
    params: query
  })
}

export function fetchMember(id) {
  return request({
    url: '/admin/detail/' + id,
    method: 'get'
  })
}

export function updateMember(id, data) {
  return request({
    url: '/admin/update/' + id,
    method: 'post',
    data
  })
}

export function addMember(data) {
  return request({
    url: '/admin/add',
    method: 'post',
    data
  })
}

export function deleteMember(id) {
  return request({
    url: `/admin/delete/${id}`,
    method: 'post'
  })
}

export function updateStore(adminId, storeId) {
  return request({
    url: `/admin/updateStore/${adminId}/${storeId}`,
    method: 'post'
  })
}
